﻿using LS.Entitys;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LS.Cores { 
   public interface ISysConfiguration : IRepositoryBase<SysConfigurationEntity>
    {
        /// <summary>
        /// 检查业务码是否可用
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="bm">编码</param>
        /// <returns></returns>
        bool ExistsBm(string id, string bm);
        /// <summary>
        /// 根据code获得配置信息
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        SysConfigurationEntity GetByCode(string code);
        /// <summary>
        /// 根据code获得配置值
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        string GetValueByCode(string code);

        /// <summary>
        /// 自动获取订单号
        /// </summary>
        /// <param name="billName">单据类型</param>
        /// <param name="prefixes">前缀字符</param>
        /// <param name="isContinuous">是否连续号码 0否 1=是</param>
        /// <param name="billLen">单号长度</param>
        /// <returns></returns>
        string GetBillNumber(string billName,string prefixes,int isContinuous=0, int billLen=6);

    }
}
